﻿using System;
using System.Runtime.InteropServices;
using Ast.Core.WinApi;

namespace Ast.Core.Services.ObjectDefinitions
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
    public struct CmKeyBody
    {
        public uint Type;

        public IntPtr KeyControlBlock;

        public IntPtr NotifyBlock;

        public int ProcessID;

        public Structure.ListEntry KeyBodyList;
    }

    /*
lkd> dt _CM_KEY_BODY -v
nt!_CM_KEY_BODY
struct _CM_KEY_BODY, 10 elements, 0x2c bytes
    +0x000 Type             : Uint4B
    +0x004 KeyControlBlock  : Ptr32 to struct _CM_KEY_CONTROL_BLOCK, 47 elements, 0xa0 bytes
    +0x008 NotifyBlock      : Ptr32 to struct _CM_NOTIFY_BLOCK, 8 elements, 0x2c bytes
    +0x00c ProcessID        : Ptr32 to Void
    +0x010 KeyBodyList      : struct _LIST_ENTRY, 2 elements, 0x8 bytes
    +0x018 Flags            : Bitfield Pos 0, 16 Bits
    +0x018 HandleTags       : Bitfield Pos 16, 16 Bits
    +0x01c KtmTrans         : Ptr32 to Void
    +0x020 KtmUow           : Ptr32 to struct _GUID, 4 elements, 0x10 bytes
    +0x024 ContextListHead  : struct _LIST_ENTRY, 2 elements, 0x8 bytes
    */
}